//添加
function Storage(warehouse,data){ 
	    for(var l in localStorage){
	    	//读取 key
	     	if(l==warehouse){
	     		//读取本地 data key
	     	 	for(var i in JSON.parse(localStorage.getItem(warehouse))){
				  console.log(i+"---------");
				  //读取传入的key
				  	for(var z in data){
				 		console.log(z+"--"+data[z]);
				 		//x相等 重新赋值
          				if(i==z){
          				console.log("++++++"+JSON.parse(localStorage.getItem(warehouse))[i]);
          				JSON.parse(localStorage.getItem(warehouse))[i]=data[z];
          		//如果 data 中 无 本地的 某条数据  加入
         				 }else{
               				data[i]=JSON.parse(localStorage.getItem(warehouse))[i];
          				 }
					}
				}
	     	}else{
	     		   localStorage.setItem(warehouse,JSON.stringify(data));
	     	}
	    }
	    
}
//删除一条
function removes(warehouse,flag){
	if(flag==true){
		for(var l in localStorage){
			if(warehouse==l){
				localStorage.removeItem(l);
			}
		}
	}else{
		localStorage.clear();
	}
}

Storage("you",{'names': 'rainman22d', 'agef':2244,'sexx':"nans"});
Storage("you3",{'names': 'rainman22d', 'agef':2244,'sexx':"nans"});
Storage("you",{'names': 'rainman22dww', 'agef':2244,'sexx':"nans",'sexee':"nans"});
Storage("you2",{'names': 'rainman22d', 'agef':2244,'sexx':"nans"});
removes("you",false);
